const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');

module.exports = {
  entry: {
    index: './src/index.ts'
  },
  output:{
    path: '/dist',
    filename: '[name].js'
  },
  module:{
    rules:[
      {
        test: /\.ts?$/,
        loader: 'ts-loader',
        exclude: /node_modules/
      },
      {
        test: /\.png$/,
        loader: 'url-loader',
        exclude: /node_modules/
      }
    ]
  },
  devServer:{
    port: 9010
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js'],
    alias:{
      "src":path.resolve(__dirname, 'src'),
      "ProxyPattern":path.resolve(__dirname, 'src/ProxyPattern')
    }
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: 'src/index.html',
      inject: true
    })
  ]
};